<template>
    <div class="zxcard" @click="hdjump(data.zxurl)">
        <div class="zxcardimg">
            <img alt="example" :src="data.zximg" mode="widthFix">
        </div>
        <div class="zxcardbody">
            <div class="title"><div class="iconbadge new" v-if="newzx">new</div>{{data.zxname}}</div>
            <div class="description">
				<div class="tag">{{data.zxxm}}</div>
                <div class="tag">{{data.zxleixing}}</div>
            </div>
        </div>
    </div>
</template>

<script>
    export default {
        props:{
            data:{
                type: Object,
                default: () => {}
            },
        },
        data() {
            return {
                thistime: new Date(),
                newzx: false
            }
        },
        created(){
            if (new Date(this.data.createtime*1000).toDateString() === this.thistime.toDateString()) {
                this.newzx = true
            }
        },
        methods: {
            hdjump(hdhref){
                if (hdhref) {
					var tapurl = encodeURIComponent(hdhref)
					wx.navigateTo({
						url:'../../pages/webview/index?href=' + tapurl,
					})
				} else {
					wx.showToast({
						title: '内容暂无，敬请期待',
						icon: "none"
					})
				}
            }
        },
    }
</script>

<style scoped>
</style>
